home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
126-150
/
disk_126
/
suplib
/
atoi.c
< prev
next >
Wrap
Text File
|
1992-05-06
|
345b
|
26 lines
/*
* atoi()
*
* Uses shifts instead of multiplies.
*/
long
atoi(str)
register char *str;
{
register long i = 0;
register long neg = 0;
while (*str == ' ')
++str;
if (*str == '-') {
++str;
neg = 1;
}
while (*str >= '0' && *str <= '9')
i = (i << 1) + (i << 3) + *str++ - '0';
return ((int)((neg)?-i:i));
}